import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

import App from './App.vue'
import router from './router'
import moment from 'moment'

const app = createApp(App)

const pinia = createPinia()


// pinia.use(piniaPluginPersistedstate)

app.use(pinia)
app.use(router)
app.use(ElementPlus)
app.config.globalProperties.$moment = moment
app.config.globalProperties.$formatDate = (value, format) => {
  if (!value) return ''

  return moment(value).format(format)
}

app.mount('#app')
